import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '品牌名称',
    align: "center",
    dataIndex: 'brandName'
  },
  {
    title: '状态',
    align: "center",
    dataIndex: 'state'
  },
  {
    title: '品牌介绍',
    align: "center",
    dataIndex: 'brandIntroduction'
  },
  {
    title: '制单人ID',
    align: "center",
    dataIndex: 'creatorId'
  },
  {
    title: '制单人姓名',
    align: "center",
    dataIndex: 'creatorName'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "品牌名称",
    field: 'brandName',
    component: 'Input',
    colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '品牌名称',
    field: 'brandName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入品牌名称!'},
             ];
    },
  },
  {
    label: '状态',
    field: 'state',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入状态!'},
             ];
    },
  },
  {
    label: '品牌介绍',
    field: 'brandIntroduction',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入品牌介绍!'},
             ];
    },
  },
  {
    label: '制单人ID',
    field: 'creatorId',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入制单人ID!'},
             ];
    },
  },
  {
    label: '制单人姓名',
    field: 'creatorName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入制单人姓名!'},
             ];
    },
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
